<!DOCTYPE HTML>
<html>
 <head>
  <title>绝对居中 </title>
   <style type="text/css">
 h1, h2, h3, h4, h5 {
    margin:0px;
    padding:0px;
}
.panel {
    width:300px;
    height:150px;
    background:#000;
    color:green;
    display:table;
    float:left;
    margin-right:30px;
}
.absolute-center {
    vertical-align:middle;
    display:table-cell;
    text-align:center;
}
   </style>
 </head>
 <body>
 <div class="panel">
    <div class="absolute-center">
         <h1>LPJT</h1>
         <h5>(龙破九天)</h5>
    </div>
</div>
<div class="panel">
    <div class="absolute-center">
         <h1>XAJT</h1>
         <h5>(笑傲九天)</h5>
    </div>
</div>
<script>
    function once(fn, context) { 
    var result;
 
    return function() { 
        if(fn) {
            result = fn.apply(context || this, arguments);
            fn = null;
        }
        console.log(result,"ss");
 
        return result;
    };
}
 
// Usage
var canOnlyFireOnce = once(function() {
    console.log('Fired!');
});
 
canOnlyFireOnce(); // "Fired!"
// canOnlyFireOnce(); // nothing
</script>
 </body>
</html>